package cn.iocoder.yudao.module.vos.dal.mysql.pushlistconfig;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.vos.dal.dataobject.pushlistconfig.PushListConfigDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.vos.controller.admin.pushlistconfig.vo.*;

/**
 * 名单推送配置 Mapper
 *
 * @author shijun
 */
@Mapper
public interface PushListConfigMapper extends BaseMapperX<PushListConfigDO> {

    default PageResult<PushListConfigDO> selectPage(PushListConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PushListConfigDO>()
                .eqIfPresent(PushListConfigDO::getRechargeTenantId, reqVO.getRechargeTenantId())
                .eqIfPresent(PushListConfigDO::getListLevel, reqVO.getListLevel())
                .eqIfPresent(PushListConfigDO::getPullCount, reqVO.getPullCount())
                .eqIfPresent(PushListConfigDO::getEnabled, reqVO.getEnabled())
                .betweenIfPresent(PushListConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PushListConfigDO::getId));
    }

}